package eip.chapter8.expiration.impl;

import org.apache.axiom.om.OMElement;
import org.apache.log4j.Logger;
import org.jibx.runtime.JiBXException;

import eip.chapter8.expiration.RestaurantResponse;
import eip.util.JibxUtil;

public class RestaurantInquiryClientWebserviceFacade {
	private final static Logger LOG = Logger.getLogger(RestaurantInquiryClientWebserviceFacade.class);
	RestaurantInquiryClientImpl client = new RestaurantInquiryClientImpl();
	
	public void processResponse(OMElement response) throws JiBXException {
		LOG.info("Message received by RestaurantInquiryClientWebserviceFacade");
		RestaurantResponse restaurantResponse = (RestaurantResponse) JibxUtil.unmarshall(response.toString(),RestaurantResponse.class);			
		client.processResponse(restaurantResponse);
	}
}
